package com.wolf.cx330.view.act

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.viewpager2.widget.ViewPager2
import com.wolf.cx330.R
import com.wolf.cx330.view.adapter.AvdAnimFragAdapter
import com.wolf.cx330.view.frag.CameraAnimFrag
import com.wolf.cx330.view.frag.CircleRadiusAnimFrag
import com.wolf.cx330.view.frag.PointAnimFrag
import com.wolf.cx330.view.frag.TextAnimFrag
import kotlinx.android.synthetic.main.activity_value_property_anim.*

/**
 * 属性动画和硬件加速
 */
class ValuePropertyAnimAct : AppCompatActivity() {
    companion object {
        fun actionStart(context: Context) =
            context.startActivity(Intent(context, ValuePropertyAnimAct::class.java))
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_value_property_anim)
        //  设置竖直滑动
        vpaViewPager2.orientation = ViewPager2.ORIENTATION_VERTICAL
        //  设置Adapter
        vpaViewPager2.adapter = AvdAnimFragAdapter(
            this, mutableListOf(
                CircleRadiusAnimFrag(),
                PointAnimFrag(),
                CameraAnimFrag(),
                TextAnimFrag()
            )
        )
    }
}